
<style type="text/css">
	.stafflist{
		width: 60px;text-align: center;float: left;
	}
	.stafflist img{
		width: 40px;
		height: 40px;
		margin: 10px;
		border-radius:50%;
	}
	.level{
		width: 100px;text-align: center;float: left;padding-top:18px;
		margin-left: 30px;
	}
	.level span:first-child{
		line-height: 2em
	}
</style>
<form id="add-form" class="form-horizontal col-sm-12" role="form" data-toggle="validator" method="POST" action="">
	{:token()}
	<div class="form-group">
		<div class="alert alert-warning-light no-margin">
			基础信息
		</div>
	</div>
	<div class="form-group">

		<div class="col-xs-12 col-sm-6">
			<div class="form-group col-sm-10">
				<label >归属客户:</label>
				<input type="hidden" name="row[customer_id]" data-rule="required" value="{$customer_id}" >
				<div class="form-control">
					<a href="javascript:void(0)" class="select-customer" data-name="row[customer_id]"
					   data-url="qingdongams/customer/customer/index?isselect=1"
					>{if condition="$customer"}{$customer.name}{else/}【请点击选择】{/if}</a>
				</div>
			</div>
		</div>
		<div class="col-xs-12 col-sm-6">
			<div class="form-group col-sm-10">
				<label >关联订单:</label>
				<input type="hidden" name="row[contract_id]" data-rule="required" value="{$contract_id}" >
				<div class="form-control">
					<a href="javascript:void(0)" class="select-contract" data-name="row[contract_id]"
					   data-url="qingdongams/customer/contract/index?isselect=1"
					>{if condition="$contract"}{$contract.name}{else/}【请点击选择】{/if}</a>
				</div>
			</div>
		</div>

		<div class="col-xs-12 col-sm-6">
			<div class="form-group col-sm-10">
				<label for="c-number">发票申请编号:</label>
				<input id="c-number" data-rule="required" class="form-control "
					   placeholder="自动生成发票申请编号" name="row[number]" type="text" value="{$number}">
			</div>
		</div>

		<div class="col-xs-12 col-sm-6">
			<div class="form-group col-sm-10">
				<label for="c-money">开票金额:</label>
				<input id="c-money" data-rule="required" class="form-control"   placeholder="请输入开票金额" name="row[money]" type="number">
			</div>
		</div>
		<div class="col-xs-12 col-sm-6">
			<div class="form-group col-sm-10">
				<label for="c-next_time">开票日期:</label>
				<input id="c-next_time" data-rule="required" class="form-control datetimepicker"  placeholder="请选择开票日期" name="row[time]" type="text">
			</div>
		</div>
		<div class="col-xs-12 col-sm-6">
			<div class="form-group col-sm-10">
				<label for="consume-type">开票类型:</label>
				<select id="consume-type" class="form-control" name="row[type]">
					<option value="0">增值税专用发票</option>
					<option value="1">增值税普通发票</option>
					<option value="2">国税通用机打发票</option>
					<option value="3">地税通用机打发票</option>
					<option value="4">收据</option>
				</select>
			</div>
		</div>
		<div class="col-xs-12 col-sm-10">
			<div class="form-group col-sm-10">
				<label for="c-remark">备注:</label>
				<textarea id="c-remark" class="form-control" rows="3" name="row[remark]" placeholder="请输入备注"></textarea>
			</div>
		</div>
	</div>
	<div class="form-group">
		<div class="alert alert-warning-light no-margin">
			发票信息
		</div>
	</div>
	<div class="form-group">
		<div class="col-xs-12 col-sm-6">
			<div class="form-group col-sm-10">
				<label for="consume-type">抬头类型:</label>
				<select  class="form-control" name="row[head_type]">
					<option value="0">单位</option>
					<option value="1">个人</option>
				</select>
			</div>
		</div>
		<div class="col-xs-12 col-sm-6">
			<div class="form-group col-sm-10">
				<label for="c-money">开票抬头:</label>
				<input   class="form-control "   placeholder="请输入开票抬头" name="row[invoice_header]" type="text">
			</div>
		</div>
		<div class="col-xs-12 col-sm-6">
			<div class="form-group col-sm-10">
				<label for="c-money">纳税人识别号:</label>
				<input   class="form-control "   placeholder="请输入纳税人识别号" name="row[taxpayer_number]" type="text">
			</div>
		</div>
		<div class="col-xs-12 col-sm-6">
			<div class="form-group col-sm-10">
				<label for="c-money">开户行:</label>
				<input   class="form-control "   placeholder="请输入开户行" name="row[bank_deposit]" type="text">
			</div>
		</div>
		<div class="col-xs-12 col-sm-6">
			<div class="form-group col-sm-10">
				<label for="c-money">开户账号:</label>
				<input   class="form-control "   placeholder="请输入开户账号" name="row[bank_account]" type="text">
			</div>
		</div>
		<div class="col-xs-12 col-sm-6">
			<div class="form-group col-sm-10">
				<label for="c-money">开票地址:</label>
				<input   class="form-control "   placeholder="请输入开票地址" name="row[invoice_address]" type="text">
			</div>
		</div>
		<div class="col-xs-12 col-sm-6">
			<div class="form-group col-sm-10">
				<label for="c-money">电话:</label>
				<input   class="form-control "   placeholder="请输入电话" name="row[invoice_mobile]" type="text">
			</div>
		</div>
		</div>
		<div class="form-group">
			<div class="alert alert-warning-light no-margin">
				邮寄信息
			</div>
		</div>
		<div class="form-group">
			<div class="col-xs-12 col-sm-6">
				<div class="form-group col-sm-10">
					<label for="c-money">联系人:</label>
					<input   class="form-control "   placeholder="请输入联系人" name="row[contacts]" type="text">
				</div>
			</div>
			<div class="col-xs-12 col-sm-6">
				<div class="form-group col-sm-10">
					<label for="c-money">联系方式:</label>
					<input   class="form-control "   placeholder="请输入联系方式" name="row[phone]" type="text">
				</div>
			</div>
			<div class="col-xs-12 col-sm-6">
				<div class="form-group col-sm-10">
					<label for="c-money">邮寄地址:</label>
					<input   class="form-control " data-toggle="city-picker"  placeholder="请选择邮寄地址" name="row[address]" type="text">
				</div>
			</div>
			<div class="col-xs-12 col-sm-6">
				<div class="form-group col-sm-10">
					<label for="c-money">详细地址:</label>
					<input   class="form-control "   placeholder="请输入详细地址" name="row[address_detail]" type="text">
				</div>
			</div>
			<div class="col-xs-12 col-sm-12" id="consume-content">

			</div>

			{if condition="$flow.status == 1"}

			<div class="col-xs-12 col-sm-12">
				<div class="form-group col-sm-10">

					<blockquote style="padding: 2px 10px;">
						<p>审核信息 <span class="label label-danger">固定审批流</span></p>
					</blockquote>

					{foreach name="$flow.stepList" item="val"}
					<div class="row">
						<div class="level">
							<span>第{$val.order_id}级</span><br>
							{if condition="$val.status == 3"}
							<span class="label label-info">发起人主管</span>
							{elseif condition="$val.status == 1"/}
							<span class="label label-info">{:count($val['stafflist'])}人或签</span>
							{else/}
							<span class="label label-info">{:count($val['stafflist'])}人并签</span>
							{/if}
						</div>
						{foreach name="$val.stafflist" item="ves"}
						<div class="stafflist">
							<img src="{$ves.img}" class="img-circle">
							{$ves.name}
						</div>
						{/foreach}
					</div>
					<hr>
					{/foreach}


				</div>
			</div>

			{else/}

			<div class="col-xs-12 col-sm-12">
				<div class="form-group col-sm-8">

					<blockquote style="padding: 2px 10px;">
						<p>审核信息 <span class="label label-danger">发起人自选</span></p>
					</blockquote>
					<div style="margin-left: 20px">
						<input data-source="qingdongams/customer/contract/getstaff"
							   class="form-control selectpage" placeholder="请选择审批人" data-pagination="true" data-page-size="10" name="row[flow_staff_ids]" type="text" data-multiple="true">
					</div>

				</div>
			</div>
			{/if}
	</div>


	<div class="form-group layer-footer">
		<label class="control-label col-xs-12 col-sm-2"></label>
		<div class="col-xs-12 col-sm-8">
			<button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
			<button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
		</div>
	</div>
</form>
